sqlplus -s dbuser/oracle <<EOF >/dev/null
set heading off;
set term off;
set echo off;
set pagesize 0;
set linesize 1000;
set trimspool on;
set trimout on;
set feedback off;
set colsep |;
spool tmp.txt;
select user_nm,count(*),max(log_sq) from user_log group by user_nm having(count(*)>1);
spool off;
exit
EOF
tr -d ' ' < tmp.txt | awk -f purge.awk > del.sql
